﻿<?php
	include '../inc/conn.php';
	
	session_start();	
?>
<?
	extract($_POST);
	extract($_GET);
	unset($_POST,$_GET);
	if (isset($act) && isset($id))
	{
		if ($act == "del"){
			$db = new mysql();
			$db->delete('validate_issues', "id=".$id);
			$db->close();
			echo "<script>alert('Data has deleted!!!');window.location='admin_index.php?name=issue';</script>";
		}
	}
?>
<div class="container">
<? if ($_SESSION['user'] != 1){  
	echo '<script>window.location="userinfo.php"</script>';
 } else {
?>
<div class="panel panel-primary">
    <div class="panel-heading">
        <h3 class="panel-title">管理面板>>问题点汇总表</h3>
    </div>
    <div class="panel-body">
	<div>
		<table border=0 cellpadding=0 class="table table-hover">
		<tr><th>Item</th><th>问题点</th><th>分析人员</th><th>状态</th><th>Admin</th></tr>
<?
		$db = new mysql();
		$db->query("select * from validate_issues ORDER BY val_date DESC");
		$num = $db->db_num_rows();
		for($i=0; $i<$num; $i++){
			$row = $db->fetch_assoc();
			$item = $i + 1;
			echo "<tr>";
			echo "<td>$item</td>";
			echo "<td><a href=\"../review_issue.php?id=".$row['id']."\">".htmlspecialchars_decode($row['val_reason'])."</a></td>";
			echo "<td>".htmlspecialchars_decode($row['val_owner'])."</td>";
			echo "<td>".$row['val_status']."</td>";
			echo "<td><a href=\"mod_issue.php?id=".$row['id']."\" rel='tooltip' title='修改问题点'>[改]</a>";
			if (isset($_SESSION['admin']))
				echo "&nbsp;|&nbsp;<a href=\"admin8.php?id=".$row['id']."&act=del\" rel='tooltip' title='删除问题点，当心哦~~~'><font color='red'>删</font></a></td>";
			echo "</tr>\n";
		}
?>
		</table>
	</div>
</div>
</div>
</div>
<? 
}
//	include 'bottom.php';
	$db->close();
?>
